﻿/**
 * 
 * @file FITKAbstractSEASubSys.h
 * @brief 子系统抽象类
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-06
 * 
 */
#ifndef _FITK_ABSTRACTSEA_SUB_SYS_H___
#define _FITK_ABSTRACTSEA_SUB_SYS_H___
 
#include "FITKAcousticsModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractNDataObject.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataManager.hpp"

namespace Interface
{
    class FITKNodeList;
    class FITKCoordinateSystem;
}

namespace Acoustics
{
    class FITKAcousticsAbsPhysicsProp;
    class FITKAcousticsAbsMaterial;
    class FITKSEASubSysGeoProp;
    /**
  * @brief 子系统抽象类
  * @author LiBaojun (libaojunqd@foxmail.com)
  * @date 2024-10-06
  */
    class FITKAcousticsModelAPI FITKAbstractSEASubSys : public Core::FITKAbstractNDataObject
    {
        Q_OBJECT
    public:
        /**
         * @brief 子系统类型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        enum SEASubSysType
        {
            SEASSNone,                  ///< 空
            SEABeam,                    ///< 梁
            SEAFlatPlate,               ///< 平板
            SEASinglyCurvedShell,       ///< 单曲率板
            SEADoublyCurvedShell,       ///< 双曲率板
            SEACylinderShell,           ///< 圆柱面
            SEACavity,                  ///< 声腔
            SEASemiIInfiniteFluid,      ///< 半无限流体
        };
        Q_ENUM(SEASubSysType);
      

        /**
         * @brief Construct a new FITKAbstractSEASubSys object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        explicit FITKAbstractSEASubSys();
        /**
         * @brief Destroy the FITKAbstractSEASubSys object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual ~FITKAbstractSEASubSys() = 0;
        /**
        * @brief 获取子系统类型
        * @return SEASubSysType
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-10-06
        */
        virtual SEASubSysType getSEASubSysType() = 0;

        /**
         * @brief 获取节点ID列表
         * @return QList<int>
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual QList<int> getNodeIDs() const;
        /**
        * @brief 获取三角形使用的节点ID
        * @return QList<int>
        * @author LiBaojun (libaojunqd@foxmail.com)
        * @date 2024-11-19
        */
        virtual QList<int> getTriangleNodeIDs();
        /**
          * @brief 设置物理属性ID
          * @param[i]  pid            物理属性ID
          * @author LiBaojun (libaojunqd@foxmail.com)
          * @date 2024-10-15
          */
        virtual void setPropSection(const int pid);
        /**
         * @brief 获取物理属性ID
         * @return int
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        virtual int getPropSectionID();
        /**
         * @brief 获取物理属性对象
         * @return FITKAcousticsAbsPhysicsProp*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        virtual FITKAcousticsAbsPhysicsProp* getPropSectionObj();
        /**
         * @brief 设置材料ID，与propertySection无关
         * @param[i]  matID          材料ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        virtual  void setMaterialID(const int matID);
        /**
         * @brief 获取材料ID，与propertySection无关
         * @return int 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        virtual int getMaterialID() const;
        /**
         * @brief 获取材料对象，与propertySection无关
         * @return FITKAcousticsAbsMaterial* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        virtual FITKAcousticsAbsMaterial* getAcousticsMaterial();
        /**
         * @brief 更新几何属性
         * @return bool
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        virtual bool updateGeoProp();

        /**
         * @brief 获取几何属性
         * @return FITKSEASubSysGeoProp
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        FITKSEASubSysGeoProp* getGeoProp();
        
        /**
         * @brief 获取局部坐标系
         * @return Interface::FITKCoordinateSystem*
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-13
         */
        Interface::FITKCoordinateSystem* getCoordinateSys();
        /**
         * @brief 是否包含点
         * @param[i] id 节点ID
         * @return bool 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-14
         */
        virtual bool isContainsNode(const int id) const;

     protected:
         /**
         * @brief 更新局部坐标系
         * @return bool
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-13
         */
         virtual bool updateCoordinate();

    protected:
        /**
         * @brief 物理属性ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        int _propSection{ -1 };
        /**
         * @brief 材料ID
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        int _materialID{ -1 };
        /**
         * @brief 几何属性
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-04
         */
        FITKSEASubSysGeoProp* _geoProp{};
        /**
         * @brief 几何属性
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-11-13
         */
        Interface::FITKCoordinateSystem* _coordinate{};
    };


    /**
     * @brief 子系统管理器
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-15
     */
    class FITKAcousticsModelAPI FITKAcousticsSEASubSysManager : public Core::FITKAbstractDataObject,
        public Core::FITKAbstractDataManager<FITKAbstractSEASubSys>
    {
        FITKCLASS(Acoustics, FITKAcousticsSEASubSysManager);
    public:
        /**
         * @brief Construct a new FITKAcousticsSEASubSysManager object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        explicit FITKAcousticsSEASubSysManager() = default;
        /**
         * @brief Destroy the FITKAcousticsSEASubSysManager object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        virtual ~FITKAcousticsSEASubSysManager() = default;
        /**
         * @brief 根据类型获取子系统
         * @param[i]  type           子系统类型
         * @return QList<FITKAbstractSEASubSys*> 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-15
         */
        QList<FITKAbstractSEASubSys*> getSubSysByType(FITKAbstractSEASubSys::SEASubSysType type);

    };

}


#endif
